import Vue from 'vue'
import App from './App'
import i18n from './common/locales'
import store from './store'

// 引入工具类
import {
	msg,
	showLoading,
	hideLoading,
	isLogin,
	getToken,
	getUserInfo,
	getFileSize
} from '@/common/js/util'
import {
	get,
	post,
	postBody,
	getNoAuth,
	postNoAuth,
	postBodyNoAuth
} from '@/common/js/request'

Vue.config.productionTip = false

// 全局挂载的方法
Vue.prototype.$store = store
Vue.prototype.msg = msg;
Vue.prototype.showLoading = showLoading;
Vue.prototype.hideLoading = hideLoading;
Vue.prototype.isLogin = isLogin;
Vue.prototype.getToken = getToken;
Vue.prototype.getUserInfo = getUserInfo;
Vue.prototype.get = get;
Vue.prototype.post = post;
Vue.prototype.postBody = postBody;
Vue.prototype.getNoAuth = getNoAuth;
Vue.prototype.postNoAuth = postNoAuth;
Vue.prototype.postBodyNoAuth = postBodyNoAuth;
Vue.prototype.getFileSize = getFileSize;

App.mpType = 'app'

const app = new Vue({
	store,
	i18n,
	...App
})
app.$mount()
